<?php
/**
 * Created by PhpStorm.
 * User: lenove
 * Date: 17-10-19
 * Time: 下午2:19
 */

namespace App\Http\Models;

use App\Libs\Constant;

class ArticleModels {
    public static function getArticleList($keyWord = '', $pageSize = Constant::PAGE_SIZE)
    {
        $list = DB::tabel("articles")
                ->where("status", "!=", 0)
                ->where(function ($query) use ($keyWord){
                    if($query){
                        $query ->where("title","%".$keyWord."%");
                    }
                })
                ->paginate($pageSize);
        return $list;
    }
} 